/**
 * Static methods
 */
package smallChanges.util;


/**
 * @author jspacco
 *
 */
public class SCUtilities implements SCConstants
{
	/**
	 * Remove the preceeding /trunk/ or /branches/branchname/ from a path.
	 * @param path
	 * @return
	 */
	public static String trimPath(String path)
	{
		return path.replaceAll(PRECEEDING_PATH_REGEXP, "");
	}
	
	/**
	 * Remove the preceeding /trunk/ or /branches/branchname/ from a path.
	 * @param path
	 * @return
	 */
	public static String trimProjectNameFromPath(String path)
	{
		int firstSlash = path.indexOf("/trunk/");
		if(firstSlash == -1 )
		{
			firstSlash = path.indexOf("/branches/");
		}
		if( firstSlash != -1)
		{
			path = path.substring(firstSlash);
		}
		return path;
	}

}
